package br.unicamp.ic.lis.dbvapi.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "PhysicalVersion")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@DiscriminatorColumn(name = "PhysicalVersionType")
public abstract class AbstractPhysicalVersion<VALUE> implements Serializable {

	private static final long serialVersionUID = -4058885978490921722L;

	public static enum DataType {
		TABLE, FILE
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "pvid")
	protected long id;

	@Transient
	protected VALUE value;

	public abstract VALUE getValue();

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}
}
